<template>
  <!--  父组件通过`v-on`监听子组件的事件,不管子组件是通过`$emit`还是`defineEmits`触发的事件,父组件都可以监听到.-->
  <SonEmitsDemo @sonEmitEvent="handleSonEmitsEvent"
                @sonDefineEmitsEvent="handleSonDefineEmitsEvent"
  />
</template>

<script setup>
import SonEmitsDemo from "./SonEmitsDemo.vue";

const handleSonEmitsEvent = (msg) => {
  alert(`Received event from son: ${msg}`)
}
const handleSonDefineEmitsEvent = (msg) => {
  alert(`Received event from son: ${msg}`)
}
</script>


<style scoped>

</style>